package com.zxy.model;

import org.springframework.stereotype.Component;

@Component
public class AdminInfo {
    private int id;
    private String loginName;
    private String pwd;

    public AdminInfo() {
    }

    public AdminInfo(String loginName, String pwd) {
        this.loginName = loginName;
        this.pwd = pwd;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Override
    public String toString() {
        return "AdminInfo{" +
                "id='" + id + '\'' +
                ", loginName='" + loginName + '\'' +
                ", pwd='" + pwd + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        AdminInfo adminInfo = (AdminInfo) o;

        if (id != adminInfo.id) return false;
        if (loginName != null ? !loginName.equals(adminInfo.loginName) : adminInfo.loginName != null) return false;
        return pwd != null ? pwd.equals(adminInfo.pwd) : adminInfo.pwd == null;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (loginName != null ? loginName.hashCode() : 0);
        result = 31 * result + (pwd != null ? pwd.hashCode() : 0);
        return result;
    }
}
